package com.util;

import com.po.UserPO;

/**
 * @author linyukun
 * @date 2022/7/7 10:40
 */
public class UserLocal {
    private static final ThreadLocal<UserPO> USER = new ThreadLocal<>();

    public static UserPO get() {
        UserPO userX = USER.get();
        if(userX == null) {
            return new UserPO();
        }
        return userX;
    }

    public static void set(UserPO ux) {
        USER.set(ux);
    }

    public static void clear() {
        USER.remove();
    }
}
